package com.xbb.mapper;

import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface EcartsMapper {
    //获取咨询师各自所分配的学生（客户）--x轴
    @Select("select login_name from users,(select user_id ,count(*) as num from student group by user_id " +
            ") b where users.id=b.user_id")
    public List<String> getZxsName();

    //获取咨询师各自所分配的学生（客户）--y轴
    @Select("select num from users,(select user_id ,count(*) as num from student group by user_id " +
            ") b where users.id=b.user_id")
    public List<Integer> getZxsNum();

    //获取咨询师所分配的学生（客户）转变已缴费学生（客户）--y轴
    @Select("select ifnull(b.num,0) from \n" +
            "\t\t\t(select user_id from student where user_id is not null  group by user_id) as a \n" +
            "\t\t\tleft join  \n" +
            "\t\t\t(select user_id,count(*) num from student where is_fees='已缴费' and  user_id is not null  group by user_id) b  \n" +
            "\t\t\ton a.user_id=b.user_id")
    public List<Integer> getZxsNumIn();

    //获取网络咨询师各自所录入的学生（客户）--x轴
    @Select("select entry_name from (select entry_name ,count(*) num from student group by entry_name) b")
    public List<String> getWlzxsName();

    //获取网络咨询师各自所录入的学生（客户）--y轴
    @Select("select num from (select entry_name ,count(*) num from student group by entry_name) b")
    public List<Integer> getWlzxsNum();
}
